﻿Public Class MyLog

    Shared Sub New()
        My.Application.Log.DefaultFileLogWriter.AutoFlush = True
        My.Application.Log.DefaultFileLogWriter.Append = True
        My.Application.Log.DefaultFileLogWriter.BaseFileName = "RTMOSync"
        My.Application.Log.DefaultFileLogWriter.DiskSpaceExhaustedBehavior = Logging.DiskSpaceExhaustedOption.DiscardMessages
    End Sub
    Shared Sub Log(ByVal msg As String)
        My.Application.Log.WriteEntry(Now.ToString + ": " + msg)
    End Sub

    Shared Sub Log(ByVal msg As String, ByVal ex As Exception)
        My.Application.Log.WriteEntry(Now.ToString + ": " + msg + ": " + ex.Message)
        'My.Application.Log.WriteException(ex, TraceEventType.Error, msg)
    End Sub
End Class
